﻿using HomagChina.Basic.CCT.Db.CCT_Db;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Telerik.Windows.Data;

namespace Proxy
{

    public class SearchInfoHandle
    {
        private CommonHandle Handle_Common;

        public SearchInfoHandle()
        {
            Handle_Common = new CommonHandle();
        }

        /// <summary>
        /// 根据upi获取信息
        /// </summary>
        /// <param name="Reference">Reference</param>
        /// <returns></returns>
        public T_BoardInfo GetPartInfoByReference(string Reference)
        {
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    T_BoardInfo T = Db.T_BoardInfo.FirstOrDefault(s => s.Reference == Reference);
                    return T == null ? null : T;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ObservableCollection<BoardInfoModel> GetTransOnLineInfo()
        {
            ObservableCollection<BoardInfoModel> List_Model = new ObservableCollection<BoardInfoModel>();
            List<View_TransOnlineRecordsDetail> List_T = new List<View_TransOnlineRecordsDetail>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    var TransOnlineInfos = Db.T_TransOnlineRecords.ToList();
                    foreach (var OnlineInfo in TransOnlineInfos)
                    {
                        var bReference = OnlineInfo.Reference.Split('-')[0];
                        var boardInfo = Db.T_BoardInfo.FirstOrDefault(x => x.Reference.Equals(bReference));
                        if (boardInfo != null)
                        {
                            BoardInfoModel Model = new BoardInfoModel()
                            {
                                OnlineId = OnlineInfo.Id,
                                Reference = OnlineInfo.Reference,
                                Length = boardInfo.Length,
                                Width = boardInfo.Width,
                                Thickness = boardInfo.Thickness,
                                Location = OnlineInfo.Location,
                                Feature = boardInfo.Feature

                            };
                            List_Model.Add(Model);
                        }
                    }
                    return List_Model;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 获取线上板件的详细信息
        /// </summary>
        /// <returns></returns>
        public OnlineInfoStruct GetTransOnLineDetailInfo(string Reference = "", string Location = "RT010")
        {
            try
            {
                OnlineInfoStruct onlineInfoStruct = new OnlineInfoStruct();
                using (Db_CCT Db = new Db_CCT())
                {
                    var info = Reference == "" ? Db.T_TransOnlineRecords.
                        FirstOrDefault(s => s.Location == Location) : Db.T_TransOnlineRecords.
                        FirstOrDefault(s => s.Reference == Reference && s.Location == Location);
                    if (info == null)
                    {
                        return null;
                    }
                    onlineInfoStruct.transOnlineRecords = info;
                    Reference = info.Reference.Split('-')[0];
                    onlineInfoStruct.boardInfo = Db.T_BoardInfo.FirstOrDefault(s => s.Reference.Equals(Reference));
                    return onlineInfoStruct;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }


        /// <summary>
        /// 获取缓存内板件的详细信息
        /// </summary>
        /// <returns></returns>
        public OnlineInfoStruct GetBFDetailInfo(string Location = "BF015")
        {
            try
            {
                OnlineInfoStruct onlineInfoStruct = new OnlineInfoStruct();
                using (Db_CCT Db = new Db_CCT())
                {
                    var info = Db.T_TransOnlineRecords.
                        FirstOrDefault(s => s.Location == Location && !s.Reference.Contains("ERROR"));
                    if (info == null)
                    {
                        return null;
                    }
                    onlineInfoStruct.transOnlineRecords = info;
                    var Reference = info.Reference.Split('-')[0];
                    onlineInfoStruct.boardInfo = Db.T_BoardInfo.FirstOrDefault(s => s.Reference.Equals(Reference));
                    return onlineInfoStruct;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ObservableCollection<BoardInfoModel> GetPartsInfo(string Reference = "")
        {
            int i = 0;
            ObservableCollection<BoardInfoModel> list_PartsInfoModel = new ObservableCollection<BoardInfoModel>();
            List<T_BoardInfo> boardInfos = new List<T_BoardInfo>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    boardInfos = string.IsNullOrWhiteSpace(Reference) ? Db.T_BoardInfo.ToList() : Db.T_BoardInfo.Where(s => s.Reference.Contains(Reference)).ToList();
                    foreach (var T in boardInfos)
                    {
                        BoardInfoModel Model = new BoardInfoModel();
                        Model = Handle_Common.Mapper<BoardInfoModel, T_BoardInfo>(Model, T);
                        Model.WorkCenter = "H330";
                        Model.Index = ++i;
                        list_PartsInfoModel.Add(Model);
                    }
                    return list_PartsInfoModel;
                }
            }
            catch (Exception ex)
            {
                SerilogHandle.Logger_Search.Error(ex.Message);
                return null;
            }
        }

        /// <summary>
        /// 根据Ip查询设置
        /// </summary>
        /// <param name="Ip"></param>
        /// <returns></returns>
        public ObservableCollection<SetttingAppliancesModel> GetSettingsAppliancesInfoByIp(string Ip = "")
        {
            int i = 1;
            ObservableCollection<SetttingAppliancesModel> List_Model = new ObservableCollection<SetttingAppliancesModel>();
            List<T_MachineInfo> List_T = new List<T_MachineInfo>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    if (!string.IsNullOrWhiteSpace(Ip))
                    {
                        List_T = Db.T_MachineInfo.Where(s => s.IP.Contains(Ip)).ToList();
                    }
                    else
                    {
                        List_T = Db.T_MachineInfo.ToList();
                    }
                    foreach (var T in List_T)
                    {
                        List_Model.Add(Handle_Common.Mapper<SetttingAppliancesModel, T_MachineInfo>(
                            new SetttingAppliancesModel { Index = i++ }, T));
                    }
                    return List_Model;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 根据查询设置
        /// </summary>
        /// <param name="Ip"></param>
        /// <returns></returns>
        public ObservableCollection<SetttingDirectionModel> GetSettingsDirectionInfoBySourcePos(string SourcePos = "")
        {
            int i = 1;
            ObservableCollection<SetttingDirectionModel> List_Model = new ObservableCollection<SetttingDirectionModel>();
            List<T_DirectionConfig> List_T = new List<T_DirectionConfig>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    if (!string.IsNullOrWhiteSpace(SourcePos))
                    {
                        List_T = Db.T_DirectionConfig.Where(s => s.SourcePos.Contains(SourcePos)).ToList();
                    }
                    else
                    {
                        List_T = Db.T_DirectionConfig.ToList();
                    }
                    foreach (var T in List_T)
                    {
                        List_Model.Add(Handle_Common.Mapper<SetttingDirectionModel, T_DirectionConfig>
                            (new SetttingDirectionModel() { Index = i++ }, T));
                    }
                    return List_Model;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 根据查询设置
        /// </summary>
        /// <param name="Ip"></param>
        /// <returns></returns>
        public ObservableCollection<SetttingBasicModel> GetSettingsBasicInfoByDescribe(string Describe)
        {
            int i = 1;
            ObservableCollection<SetttingBasicModel> List_Model = new ObservableCollection<SetttingBasicModel>();
            List<T_BasicInfo> List_T = new List<T_BasicInfo>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    if (!string.IsNullOrWhiteSpace(Describe))
                    {
                        List_T = Db.T_BasicInfo.Where(s => s.Describe.Contains(Describe)).ToList();
                    }
                    else
                    {
                        List_T = Db.T_BasicInfo.ToList();
                    }
                    foreach (var T in List_T)
                    {
                        List_Model.Add(Handle_Common.Mapper<SetttingBasicModel, T_BasicInfo>
                            (new SetttingBasicModel() { Index = i++ }, T));
                    }
                    return List_Model;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 获取系统版本数据
        /// </summary>
        /// <returns></returns>
        public InformationModel GetSystemInfoMation()
        {
            InformationModel InforMationModel = new InformationModel();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    InformationModel model = new InformationModel();
                    T_InformationConfig modelConfig = Db.T_InformationConfig.OrderByDescending(s => s.Id).FirstOrDefault();
                    return Handle_Common.Mapper<InformationModel, T_InformationConfig>(model, modelConfig);
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 获取报错信息
        /// Error or Warning
        ///
        /// </summary>
        /// <param name="Type">Error or Warning </param>
        /// <returns></returns>
        public ObservableCollection<ErrorMessageModel> GetErrorMessageMation(string Type)
        {
            int i = 0;
            ObservableCollection<ErrorMessageModel> List_Model = new ObservableCollection<ErrorMessageModel>();
            List<T_ErrorMessage> List_T = new List<T_ErrorMessage>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    switch (Type)
                    {
                        case "All":
                            List_T = Db.T_ErrorMessage.ToList();
                            break;

                        case "Error":

                            List_T = Db.T_ErrorMessage.Where(s => s.State == 0).ToList();
                            break;

                        case "Warning":
                            List_T = Db.T_ErrorMessage.Where(s => s.State == 1).ToList();
                            break;

                        default:
                            break;
                    }

                    foreach (var T in List_T)
                    {
                        ErrorMessageModel Model = new ErrorMessageModel();
                        Model = Handle_Common.Mapper(Model, T);
                        Model.Index = ++i;
                        List_Model.Add(Model);
                    }
                    return List_Model;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 获取当前线上的板件数量
        ///
        /// </summary>
        /// <returns></returns>
        public bool GetActivatedPartsCount()
        {
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    return Db.View_TransOnlineRecordsDetail.Count() == 0;
                }
            }
            catch (Exception ex)
            {
                return false;
            }
        }

        /// <summary>
        /// 获取总上线生产数量
        ///
        /// </summary>
        /// <returns></returns>
        public int GetTotalPartsCount()
        {
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    return Db.T_ScanRecords_Boards.Count();
                }
            }
            catch (Exception ex)
            {
                return 0;
            }
        }

        /// <summary>
        /// 获取历史信息
        /// Error or Warning
        /// </summary>
        /// <returns></returns>
        public ObservableCollection<TransHistoryModel> GetTransHistoryMation(string Type, DateTime? ArrivalTime = null, DateTime? DepartureTime = null, string Reference = null)
        {
            int i = 0;
            ObservableCollection<TransHistoryModel> List_Model = new ObservableCollection<TransHistoryModel>();
            List<T_TransHistoryRecords> List_T = new List<T_TransHistoryRecords>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    IQueryable<T_TransHistoryRecords> query = Db.T_TransHistoryRecords;

                    if (Type != "All")
                    {
                        switch (Type)
                        {
                            case "OutFeed":
                                query = query.Where(s => s.Area.Equals("OutFeed"));
                                break;

                            case "InFeed":
                                query = query.Where(s => s.State.Equals("InFeed"));
                                break;

                            default:
                                break;
                        }
                    }

                    if (ArrivalTime.HasValue)
                    {
                        query = query.Where(s => s.ArrivalTime >= ArrivalTime.Value);
                    }
                    if (DepartureTime.HasValue)
                    {
                        query = query.Where(s => s.DepartureTime <= DepartureTime.Value);
                    }
                    if (!string.IsNullOrEmpty(Reference))
                    {
                        query = query.Where(s => s.Reference == Reference);
                    }

                    List_T = query.ToList();

                    foreach (var T in List_T)
                    {
                        TransHistoryModel Model = new TransHistoryModel();
                        Model = Handle_Common.Mapper(Model, T);
                        Model.Index = ++i;
                        List_Model.Add(Model);
                    }
                    return List_Model;
                }
            }
            catch (Exception ex)
            {
                // 错误处理代码
                return null;
            }
        }

        /// <summary>
        /// 获取Position信息
        ///
        /// </summary>
        /// <returns></returns>
        public ObservableCollection<string> GetLocationInfo(bool IsContainsM)
        {
            ObservableCollection<string> List_Model = new ObservableCollection<string>();
            List<T_LocationInfo> List_T = new List<T_LocationInfo>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    List_T = IsContainsM ? Db.T_LocationInfo.Where(s => !s.Position.Equals("Off")).ToList()
                        : Db.T_LocationInfo.Where(s => !s.Section.Contains("M") && !s.Position.Equals("Off")).ToList();
                    foreach (var T in List_T)
                    {
                        List_Model.Add(T.Position);
                    }
                    return List_Model;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 获取Position信息
        ///
        /// </summary>
        /// <returns></returns>
        public List<string> GetProjectInfo()
        {
            List<string> List_Model = new List<string>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    List_Model.Add("");

                    var list = Db.T_ProjectOrder.
                        Where(s => !s.Reference.Equals("Off")).Select(s => s.Reference).ToList();

                    List_Model.AddRange(list);

                    return List_Model;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 获取Position信息
        /// </summary>
        /// <returns></returns>
        public List<T_LocationInfo> GetLocationDetailInfo(bool IsContainsM)
        {
            List<T_LocationInfo> List_T = new List<T_LocationInfo>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    List_T = IsContainsM ? Db.T_LocationInfo.ToList() :
                        Db.T_LocationInfo.Where(s => !s.Section.Contains("M")).ToList();
                    return List_T;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 根据选中的内容转换为方向值
        /// </summary>
        /// <param name="SelectedOption"></param>
        /// <returns></returns>
        public List<T_BasicInfo> GetBasicInfo()
        {
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    return Db.T_BasicInfo.ToList();
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 根据选中的内容转换为方向值
        /// </summary>
        /// <param name="SelectedOption"></param>
        /// <returns></returns>
        //public int GetDirectionDescribe(int SelectedOption)
        //{
        //    try
        //    {
        //        using (Db_CCT Db = new Db_CCT())
        //        {
        //            return int.Parse(Db.T_BasicInfo.FirstOrDefault(s => s.Describe == SelectedOption).Value);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        return 0;
        //    }
        //}

        /// <summary>
        /// 获取当前正在执行的工程单信息
        /// </summary>
        public HomagChina.Basic.CCT.Db.CCT_Db.T_ProjectOrder GetProjectOrderDetail()
        {
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    return Db.T_ProjectOrder.FirstOrDefault(s => s.State == 1);
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        ///
        public List<T_MachinePostionInfo> GetMachinePostionInfo()
        {
            List<T_MachinePostionInfo> t_MachinePostionInfo = new List<T_MachinePostionInfo>();
            try
            {
                using (Db_CCT Db = new Db_CCT())
                {
                    t_MachinePostionInfo.AddRange(Db.T_MachinePostionInfo.ToList());
                    return t_MachinePostionInfo;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public List<RouteInfoModel> GetRouteInfo()
        {
            try
            {
                List<RouteInfoModel> routeInfos = new List<RouteInfoModel>()
                {
                    #region Route_1
                    new RouteInfoModel()
                    {
                        RouteId = 1,
                        SourcePosition = "RT010",
                        TargetPosition = "BF015",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 1,
                        SourcePosition = "BF015",
                        TargetPosition = "CT020",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 1,
                        SourcePosition = "CT020",
                        TargetPosition = "BC025",
                        Direction = 99
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 1,
                        SourcePosition = "BC025",
                        TargetPosition = "OFF",
                        Direction = 10
                    },
                    #endregion

                    #region Route_2
                      new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "RT010",
                        TargetPosition = "BF015",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "BF015",
                        TargetPosition = "CT020",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "CT020",
                        TargetPosition = "CT030",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "CT030",
                        TargetPosition = "MI1_H330L",
                        Direction = 40
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "MI1_H330L",
                        TargetPosition = "MO1_H330L",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "MO1_H330L",
                        TargetPosition = "CT050",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "CT050",
                        TargetPosition = "BC055",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "BC055",
                        TargetPosition = "BC060",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "BC060",
                        TargetPosition = "CT065",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "CT065",
                        TargetPosition = "BC070",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "BC070",
                        TargetPosition = "BC075",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 2,
                        SourcePosition = "BC075",
                        TargetPosition = "OFF",
                        Direction = 10
                    },
	                #endregion
                    
                    #region Route_3
                      new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "RT010",
                        TargetPosition = "BF015",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "BF015",
                        TargetPosition = "CT020",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "CT020",
                        TargetPosition = "CT030",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "CT030",
                        TargetPosition = "MI1_H330R",
                        Direction = 50
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "MI1_H330R",
                        TargetPosition = "MO1_H330R",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "MO1_H330R",
                        TargetPosition = "CT050",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "CT050",
                        TargetPosition = "BC055",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "BC055",
                        TargetPosition = "BC060",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "BC060",
                        TargetPosition = "CT065",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "CT065",
                        TargetPosition = "BC070",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "BC070",
                        TargetPosition = "BC075",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 3,
                        SourcePosition = "BC075",
                        TargetPosition = "OFF",
                        Direction = 10
                    },
	                #endregion

                    #region Route_4
                      new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "RT010",
                        TargetPosition = "BF015",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "BF015",
                        TargetPosition = "CT020",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "CT020",
                        TargetPosition = "CT030",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "CT030",
                        TargetPosition = "BC035",
                        Direction = 30
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "BC035",
                        TargetPosition = "BC040",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "BC040",
                        TargetPosition = "CT045",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "CT045",
                        TargetPosition = "MI2_H330L",
                        Direction = 40
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "MI2_H330L",
                        TargetPosition = "MO2_H330L",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "MO2_H330L",
                        TargetPosition = "CT065",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "CT065",
                        TargetPosition = "BC070",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "BC070",
                        TargetPosition = "BC075",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 4,
                        SourcePosition = "BC075",
                        TargetPosition = "OFF",
                        Direction = 10
                    },                   
	                #endregion
                    
                    #region Route_5
                      new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "RT010",
                        TargetPosition = "BF015",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "BF015",
                        TargetPosition = "CT020",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "CT020",
                        TargetPosition = "CT030",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "CT030",
                        TargetPosition = "BC035",
                        Direction = 30
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "BC035",
                        TargetPosition = "BC040",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "BC040",
                        TargetPosition = "CT045",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "CT045",
                        TargetPosition = "MI2_H330R",
                        Direction = 50
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "MI2_H330R",
                        TargetPosition = "MO2_H330R",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "MO2_H330R",
                        TargetPosition = "CT065",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "CT065",
                        TargetPosition = "BC070",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "BC070",
                        TargetPosition = "BC075",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 5,
                        SourcePosition = "BC075",
                        TargetPosition = "OFF",
                        Direction = 10
                    },                   
	                #endregion

                    #region Route_6
                    new RouteInfoModel()
                    {
                        RouteId = 6,
                        SourcePosition = "BC025",
                        TargetPosition = "CT020",
                        Direction = 10
                    },
                    new RouteInfoModel()
                    {
                        RouteId = 6,
                        SourcePosition = "CT020",
                        TargetPosition = "CT030",
                        Direction = 10
                    }                    
                    #endregion

                };
                return routeInfos;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
    }
}